package com.happyass.controller;

import com.happyass.dao.EntertainmentDao;
import com.happyass.dao.FacilityDao;
import com.happyass.pojo.Entertainment;
import com.happyass.pojo.Facility;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;

@Controller
@RequestMapping("")
public class TicketController {
    @Autowired
    EntertainmentDao entertainmentDao;
    @Autowired
    FacilityDao facilityDao;

    @RequestMapping("/text")
    public String text(Model model){
        List<Entertainment> all=entertainmentDao.findAll();
        model.addAttribute("entertainment", all);
        return "text";
    }


    @RequestMapping("/index")
    public String index(){
        return "/index/index";
    }
    @RequestMapping("/themearea")
    public String themearea(Model model){
        List<Entertainment> entertainmentList = entertainmentDao.findAll();
        List<Facility> facilityList = facilityDao.findAll();
        model.addAttribute("entertainmentList", entertainmentList);
        model.addAttribute("facilityList", facilityList);
        return "/index/themearea";
    }
    @RequestMapping("/booking")
    public String booking(){
        return "/booking";
    }
}
